$(function(){
    $("#update-btn").click(function (){
        edit();
    })




});
function edit(){

    let empId = id;
    let emp_id = $(":input[name=emp_id]").val();
    if(emp_id.trim() === ""){
        layer.msg("顾客编号不能为空");
        return false;
    }

    let name = $(":input[name=name]").val();
    if(name.trim() === ""){
        layer.msg("顾客姓名编号不能为空");
        return false;
    }
    let phone = $(":input[name=phone]").val();
    if(phone.trim() === ""){
        layer.msg("电话号码不能为空");
        return false;
    }
    let description = $(":input[name=description]").val();
    let url = ctx + "/employee/edit";
    console.log(empId);
    $.post(url,{
        empId,
        emp_id,
        name,
        phone,
        description
    },function (resp){
        if(resp.success){
            layer.alert("修改成功",function (){
                location.href = ctx+"/employee/list";
            });
        }else{
            layer.alert(resp.error||"删除失败，请稍后再试");
        }

    },"json");
}
